package loads

import (
	"gvm/instructions/base"
	"gvm/rtda"
)

type LLOAD struct {
	base.Index8Instruction
}

func (self *LLOAD) Execute(jFrame *rtda.JFrame) {
	_lload(jFrame, self.Index)
}

func _lload(frame *rtda.JFrame, index uint) {
	v := frame.LocalVars().GetLong(index)
	frame.OperandStack().PushLong(v)
}

type LLOAD_0 struct {
	base.NoOperandsInstruction
}

func (self *LLOAD_0) Execute(jFrame *rtda.JFrame) {
	_lload(jFrame, 0)
}

type LLOAD_1 struct {
	base.NoOperandsInstruction
}

func (self *LLOAD_1) Execute(jFrame *rtda.JFrame) {
	_lload(jFrame, 1)
}

type LLOAD_2 struct {
	base.NoOperandsInstruction
}

func (self *LLOAD_2) Execute(jFrame *rtda.JFrame) {
	_lload(jFrame, 2)
}

type LLOAD_3 struct {
	base.NoOperandsInstruction
}

func (self *LLOAD_3) Execute(jFrame *rtda.JFrame) {
	_lload(jFrame, 3)
}
